package com.woniu.payback_font.service.impl;

import com.github.pagehelper.PageInfo;
import com.woniu.payback_font.entity.Account;
import com.woniu.payback_font.mapper.AccountMapper;
import com.woniu.payback_font.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    AccountMapper accountMapper;
    @Override
    public PageInfo<Account> selectAllList(Integer pageNum, Integer pageSize, String aUid, String aName, String aMobile, String aIdcar) {
        List<Account> list = accountMapper.selectAllList(aUid,  aName, aMobile, aIdcar);
        return new PageInfo<>(list);
    }

    @Override
    public Account findOne(String aUid) {
        return accountMapper.findOne(aUid);
    }

    @Override
    public void modify(BigDecimal aDebtCapita, BigDecimal aDebtInterest, BigDecimal aUsedLimit, Integer aRepaymentDate) {
        accountMapper.updateByUid(aDebtCapita,aDebtInterest,aUsedLimit,aRepaymentDate);
    }
}
